package com.yjs.app.trade.core.base.exception;

/**
 * 业务异常
 * 
 * @author hikaru
 * @since 1.0.0
 */
public class BusinessException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	/**
	 * 错误编码
	 */
	private String errorCode = null;
	
	/**
	 * 错误消息
	 */
	private String errorMessage = null;

	public BusinessException(String errorCode, String errorMessage) {
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public String getErrorCode() {
		return errorCode;
	}

	@Override
	public String getLocalizedMessage() {
		return ErrorMessages.getErrorMessage(errorCode, errorMessage);
	}

	@Override
	public String getMessage() {
		return getLocalizedMessage();
	}

}
